<?php

class CA_MetaManager
{
	public function init()
	{
		$db = &$GLOBALS['sql'];
		
		$q = $db->query("SELECT `prefix`, `tag`, `value` FROM `meta` WHERE `active` = 1");
		
		if(!$q)
		{
			if($GLOBALS['hc']->issetHook("CA_LOGGING"))
			{
				$GLOBALS['CA_Logging']->log("CA_MetaManager", "Error: " . mysql_error());
			}
			return false;
		}
		
		$meta = array();
		
		while(($r = $db->fetchArray($q)))
		{
			$meta[] = "<meta {$r['prefix']}=\"{$r['tag']}\" content=\"".addslashes($r['value'])."\" />\n";
		}
		
		$GLOBALS['tplHead']->assign("CA_Meta", implode("", $meta));
		
		return false;
	}
}

?>